package cz.zcu.fav.ratdroid.service;

import org.joda.time.LocalDateTime;
import org.joda.time.format.DateTimeFormat;
import org.joda.time.format.DateTimeFormatter;

public class RestUtils
{
	private static DateTimeFormatter formatter = DateTimeFormat
			.forPattern("yyyy-MM-dd-HH-mm");

	public static LocalDateTime convertRestTimeToJodaTime(String time)
			throws IllegalArgumentException
	{
		return formatter.parseDateTime(time).toLocalDateTime();
	}

	public static String convertJodaTimeToRestTime(LocalDateTime time)
			throws IllegalArgumentException
	{
		return time.toString(formatter);
	}

}
